import playground from './app-playground'

const rest = [playground]

const paths = rest[0].map(route => route.path)

const defaults = [
  {
    path: `*`,
    params: {
      paths: JSON.stringify(paths),
    },
    controller: require('./controller')
  }
]

/**
 * 项目路由表
 * 往数组里添加项目即可
 */
const routes = [...rest, ...defaults]

export default routes.reduce(
  (routes, item) => item ? routes.concat(item) : routes,
  []
)
